﻿using System;
using l1cs.server.model.Instance;

namespace l1cs.server.serverpackets
{
    public class S_NoSell : ServerBasePacket
    {
        private byte[] _byte = null;

        public S_NoSell( L1NpcInstance npc )
        {
            buildPacket( npc );
        }

        private void buildPacket( L1NpcInstance npc )
        {
            writeC( Opcodes.S_OPCODE_SHOWHTML );
            writeD( npc.getId() );
            writeS( "nosell" );
            writeC( 1 );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }

            return _byte;
        }

        override
        public String getType()
        {
            return "[S] _S__25_NoSell";
        }
    }
}
